<template>
    <div>
        <!-- 页面头部 -->
        <HomePageHead></HomePageHead>

        <!-- 页面导航 -->
        <HomePageNavigation></HomePageNavigation>

        <!-- 二级标题-->
        <HomeSecondaryHeading :titleName="routeName" :titleData="pageData"></HomeSecondaryHeading>
        <!-- {{ name }} -->

        <!-- 第一层 -->
        <div class="farmingPartOne">
            <div class="inner">
                <div class="innerLeft" v-if="pageData.length>=1">
                    <div class="title">
                        <h3>
                            <NuxtLink :to="{ path: `/newsList/${pageData[0].cid}`}" target="_blank" v-if="pageData[0]">
                                {{ pageData[0].title }}
                            </NuxtLink>
                            <span>
                                <NuxtLink
                                    :to="{ path: `/newsList/${pageData[0].cid}`}"
                                    target="_blank" v-if="pageData[0]">查看更多</NuxtLink>
                            </span>
                        </h3>
                    </div>
                    <div class="leftTop">
                        <div class="leftTopPhoto left" >
                            <NuxtLink :to="item.linkurl" target="_blank" v-if="pageData[0].data[0]&&pageData[0].data[0].islink==1">
                                <img :src="pageData[0].data[0].imgurl">
                                <span>{{pageData[0].data[0].title }}</span>
                            </NuxtLink>
                            <NuxtLink :to="{ path: `/newsDetail/${pageData[0].data[0].id}`, query: { listId: routeId, listName: routeName } }"
                                target="_blank" v-if="pageData[0].data[0]&&pageData[0].data[0].islink==0">
                                <img :src="pageData[0].data[0].imgurl">
                                <span>{{pageData[0].data[0].title}}</span>
                            </NuxtLink>
                        </div>
                        <ul class="left">
                            <li v-for="item in pageData[0].data">
                                <em></em>
                                <span>
                                    <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                    <NuxtLink
                                        :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                        target="_blank" v-if="item.islink==0">{{ item.title }}
                                    </NuxtLink>
                                </span>
                            </li>
                        </ul>
                    </div>
                    <ul class="leftBottom" v-if="pageData[0]">
                        <li v-for="item in pageData[0].data2">
                            <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">
                                <img :src="item.imgurl">
                            </NuxtLink>
                            <NuxtLink
                                :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                target="_blank" v-if="item.islink==0">
                                <img :src="item.imgurl">
                            </NuxtLink>
                            <p>
                                <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                <NuxtLink
                                    :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                    target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                            </p>
                        </li>
                    </ul>
                </div>
                <div class="innerRight" v-if="pageData.length>=2">
                    <div class="title">
                        <h3>
                            <NuxtLink :to="{ path: `/newsList/${pageData[1].cid}`}" target="_blank" v-if="pageData[1]">
                                {{ pageData[1].title }}
                            </NuxtLink>
                            <span>
                                <NuxtLink
                                    :to="{ path: `/newsList/${pageData[1].cid}`}"
                                    v-if="pageData[1]" target="_blank">查看更多</NuxtLink>
                            </span>

                        </h3>
                    </div>
                    <ul class="rightList">
                        <li v-for="item in pageData[1].data">
                            <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                            <NuxtLink
                                :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                target="_blank" v-if="item.islink==0">
                                <img class="left" :src="item.imgurl">
                            </NuxtLink>
                            <p class="left">
                                <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                <NuxtLink
                                    :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                    target="_blank" v-if="item.islink==0">
                                    {{ item.title }}
                                </NuxtLink>
                            </p>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <!-- 三农资讯logo -->
        <HomeTopTen :imgurl="adList[0]" v-if="adList[0]"></HomeTopTen>

        <!-- 第二层 -->
        <div class="farmingPartTwo">
            <div class="inner">
                <div class="farmer"  v-if="pageData.length>=3">
                    <div class="title">
                        <h3>
                            <NuxtLink :to="{ path: `/newsList/${pageData[2].cid}`}" target="_blank" v-if="pageData[2]">
                                {{ pageData[2].title }}
                            </NuxtLink>
                            <span>
                                <NuxtLink
                                    :to="{ path: `/newsList/${pageData[2].cid}`, query: { catid: pageData[2].cid } }"
                                    v-if="pageData[2]" target="_blank">查看更多</NuxtLink>
                            </span>
                        </h3>
                    </div>
                    <div class="PartTwoPhoto" v-if="pageData[2].data[0]">
                        <NuxtLink :to="item.linkurl" target="_blank" v-if="pageData[2].data[0].islink==1">
                            <img :src="pageData[2].data[0].imgurl">
                            <span>{{ pageData[2].data[0].title }}</span>
                        </NuxtLink>
                        <NuxtLink
                            :to="{ path: `/newsDetail/${pageData[2].data[0].id}`, query: { listId: routeId, listName: routeName } }"
                            target="_blank" v-if="pageData[2].data[0].islink==0">
                            <img :src="pageData[2].data[0].imgurl">
                            <span>{{ pageData[2].data[0].title }}</span>
                        </NuxtLink>
                    </div>
                    <ul class="PartTwoList">
                        <li v-for="item in pageData[2].data">
                            <em></em>
                            <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                            <NuxtLink
                                :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                        </li>
                    </ul>
                </div>
                <div class="farmer" v-if="pageData.length>=4">
                    <div class="title">
                        <h3>
                            <NuxtLink :to="{ path: `/newsList/${pageData[3].cid}`}" target="_blank" v-if="pageData[3]">
                                {{ pageData[3].title }}
                            </NuxtLink>
                            <span>
                                <NuxtLink
                                    :to="{ path: `/newsList/${pageData[3].cid}`, query: { catid: pageData[3].cid } }"
                                    v-if="pageData[3]" target="_blank">查看更多</NuxtLink>
                            </span>
                        </h3>
                    </div>
                    <div class="PartTwoPhoto" v-if="pageData[3].data[0]">
                        <NuxtLink :to="item.linkurl" target="_blank" v-if="pageData[3].data[0].islink==1">
                            <img :src="pageData[3].data[0].imgurl">
                            <span>{{ pageData[3].data[0].title }}</span>
                        </NuxtLink>
                        <NuxtLink
                            :to="{ path: `/newsDetail/${pageData[3].data[0].id}`, query: { listId: routeId, listName: routeName } }"
                            target="_blank" v-if="pageData[3].data[0].islink==0">
                            <img :src="pageData[3].data[0].imgurl">
                            <span>{{ pageData[3].data[0].title }}</span>
                        </NuxtLink>
                    </div>
                    <ul class="PartTwoList">
                        <li v-for="item in pageData[3].data">
                            <em></em>
                            <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                            <NuxtLink
                                :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                        </li>
                    </ul>
                </div>
                <div class="farmer" v-if="pageData.length>=5">
                    <div class="title">
                        <h3>
                            <NuxtLink :to="{ path: `/newsList/${pageData[4].cid}`}" target="_blank" v-if="pageData[4]">
                                {{ pageData[4].title }}
                            </NuxtLink>
                            <span>
                                <NuxtLink
                                    :to="{ path: `/newsList/${pageData[4].cid}`, query: { catid: pageData[4].cid } }"
                                    v-if="pageData[4]" target="_blank">查看更多</NuxtLink>
                            </span>
                        </h3>
                    </div>
                    <div class="PartTwoPhoto" v-if="pageData[4].data[0]">
                        <NuxtLink :to="item.linkurl" target="_blank" v-if="pageData[4].data[0].islink==1">
                            <img :src="pageData[4].data[0].imgurl">
                            <span>{{ pageData[4].data[0].title }}</span>
                        </NuxtLink>
                        <NuxtLink
                            :to="{ path: `/newsDetail/${pageData[4].data[0].id}`, query: { listId: routeId, listName: routeName } }"
                            target="_blank" v-if="pageData[4].data[0].islink==0">
                            <img :src="pageData[4].data[0].imgurl">
                            <span>{{ pageData[4].data[0].title }}</span>
                        </NuxtLink>
                    </div>
                    <ul class="PartTwoList">
                        <li v-for="item in pageData[4].data">
                            <em></em>
                            <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                            <NuxtLink
                                :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                target="_blank" v-if="item.islink==0">
                                {{ item.title }}
                            </NuxtLink>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <!-- 三农资讯logo -->
        <HomeTopTen :imgurl="adList[1]" v-if="adList[1]"></HomeTopTen>

        <!-- 第三层 -->
        <div class="zixuntuijian">
            <div class="inner">
                <div class="innerLeft" >
                    <div class="zixunTop">
                        <div class="zixunLeft" v-if="pageData.length>=6">
                            <div class="title">
                                <h3>
                                    <NuxtLink :to="{ path: `/newsList/${pageData[5].cid}`}" target="_blank" v-if="pageData[5]">
                                        {{ pageData[5].title }}
                                    </NuxtLink>
                                    <span>
                                        <NuxtLink
                                            :to="{ path: `/newsList/${pageData[5].cid}`, query: { catid: pageData[5].cid } }"
                                            v-if="pageData[5]" target="_blank">查看更多</NuxtLink>
                                    </span>
                                </h3>
                            </div>
                            <ul class="photo_text">
                                <li v-for="(item, index) in pageData[5].data">
                                    <article v-if="index == 0">
                                        <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">
                                            <img :src="item.imgurl" alt="">
                                        </NuxtLink>
                                        <NuxtLink
                                            :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                            target="_blank" v-if="item.islink==0">
                                            <img :src="item.imgurl" alt="">
                                        </NuxtLink>
                                        <div>
                                            <h5>
                                                <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                                <NuxtLink
                                                    :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                                    target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                                            </h5>
                                            <p>
                                                <span>{{ item.author }}</span>
                                                <span>{{ getTime(item.updated_at,'month',1) }}</span>
                                            </p>
                                        </div>
                                    </article>
                                    <article v-else>
                                        <em></em>
                                        <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                        <NuxtLink
                                            :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                            target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                                    </article>
                                </li>
                            </ul>
                        </div>
                        <div class="zixunRight"  v-if="pageData.length>=7">
                            <div class="title">
                                <h3>
                                    <NuxtLink :to="{ path: `/newsList/${pageData[6].cid}`}" target="_blank" v-if="pageData[6]">
                                        {{ pageData[6].title }}
                                    </NuxtLink>
                                    <span>
                                        <NuxtLink
                                            :to="{ path: `/newsList/${pageData[6].cid}`, query: { catid: pageData[6].cid } }"
                                            v-if="pageData[6]" target="_blank">查看更多</NuxtLink>
                                    </span>

                                </h3>
                            </div>
                            <div class="towPic">
                                <div v-for="(item, index) in pageData[6].data" class="picBox">
                                    <div v-if="index <= 1">
                                        <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">
                                            <img :src="item.imgurl">
                                        </NuxtLink>
                                        <NuxtLink
                                            :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                            target="_blank" v-if="item.islink==0">
                                            <img :src="item.imgurl">
                                        </NuxtLink>
                                    </div>
                                </div>
                            </div>
                            <ul class="photo_text">
                                <li v-for="(item, index) in pageData[6].data">
                                    <article v-if="index > 1">
                                        <em></em>
                                        <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                        <NuxtLink
                                            :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                            target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                                    </article>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="zixunBottom" v-if="pageData.length>=8">
                        <img class="left" :src="pageData[7].data[0].imgurl"
                            v-if="pageData[7].data[0] && hoverStatus == 0">
                        <img class="left" :src="pageData[7].data[1].imgurl"
                            v-if="pageData[7].data[0] && hoverStatus == 1">
                        <img class="left" :src="pageData[7].data[2].imgurl"
                            v-if="pageData[7].data[0] && hoverStatus == 2">
                        <img class="left" :src="pageData[7].data[3].imgurl"
                            v-if="pageData[7].data[0] && hoverStatus == 3">
                        <img class="left" :src="pageData[7].data[4].imgurl"
                            v-if="pageData[7].data[0] && hoverStatus == 4">
                        <img class="left" :src="pageData[7].data[5].imgurl"
                            v-if="pageData[7].data[0] && hoverStatus == 5">

                        <ul class="leftList left">
                            <li v-for="(item, index) in pageData[7].data" @mouseenter="qhPic(index)">
                                <h4>
                                    <em></em>
                                    <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                    <NuxtLink
                                        :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                        target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                                </h4>
                                
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="innerRight" v-if="pageData.length>=9">
                    <div class="title">
                        <h3>
                            <NuxtLink :to="{ path: `/newsList/${pageData[8].cid}`}" target="_blank" v-if="pageData[8]">
                                {{ pageData[8].title }}
                            </NuxtLink>
                            <span>
                                <NuxtLink
                                    :to="{ path: `/newsList/${pageData[8].cid}`, query: { catid: pageData[8].cid } }"
                                    v-if="pageData[8]" target="_blank">查看更多</NuxtLink>
                            </span>

                        </h3>
                    </div>
                    <ul class="information">
                        <li v-for="item in pageData[8].data">
                            <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">
                                <img :src="item.imgurl">
                            </NuxtLink>
                            <NuxtLink
                                :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                target="_blank" v-if="item.islink==0">
                                <img :src="item.imgurl">
                            </NuxtLink>
                            <div class="text">
                                <h5>
                                    <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                    <NuxtLink :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }" target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                                </h5>
                                <p>{{ item.author }}</p>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <HomeTopTen :imgurl="adList[2]" v-if="adList[2]"></HomeTopTen>

        <div class="farming" >
            <div class="inner">
                <div class="innerLeft">
                    <div class="farmer" v-if="pageData.length>=10">
                        <h3>
                            <NuxtLink :to="{ path: `/newsList/${pageData[9].cid}`}" target="_blank" v-if="pageData[9]">
                                {{ pageData[9].title }}
                            </NuxtLink>
                            <span>
                                <NuxtLink
                                    :to="{ path: `/newsList/${pageData[9].cid}`, query: { catid: pageData[9].cid } }"
                                    v-if="pageData[9]" target="_blank">查看更多</NuxtLink>
                            </span>
                        </h3>
                        <ul>
                            <li v-for="item in pageData[9].data">
                                <em></em>
                                <span>
                                    <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                    <NuxtLink
                                        :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                        target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                                </span>
                            </li>
                        </ul>
                    </div>
                    <div class="farmer" v-if="pageData.length>=11">
                        <h3>
                            <NuxtLink :to="{ path: `/newsList/${pageData[10].cid}`}" target="_blank" v-if="pageData[10]">
                                {{ pageData[10].title }}
                            </NuxtLink>
                            <span>
                                <NuxtLink
                                    :to="{ path: `/newsList/${pageData[10].cid}`, query: { catid: pageData[10].cid } }"
                                    target="_blank" v-if="pageData[10]">查看更多</NuxtLink>
                            </span>

                        </h3>
                        <ul>
                            <li v-for="item in pageData[10].data">
                                <em></em>
                                <span>
                                    <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                    <NuxtLink
                                        :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                        target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                                </span>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="innerRight"  v-if="pageData.length>=12">
                    <h3>
                        <NuxtLink :to="{ path: `/newsList/${pageData[11].cid}`}" target="_blank" v-if="pageData[11]">
                            {{ pageData[11].title }}
                        </NuxtLink>
                        <span>
                            <NuxtLink
                                :to="{ path: `/newsList/${pageData[11].cid}`, query: { catid: pageData[11].cid } }"
                                target="_blank" v-if="pageData[11]">查看更多</NuxtLink>
                        </span>
                    </h3>
                    <div class="banner">
                        <HomeSmallSwiper :swiperData="pageData[11].data"></HomeSmallSwiper>
                    </div>
                    <div class="banner_b_img">
                        <div class="photo">
                            <article v-for="(item, index) in pageData[11].data2">
                                <div class="photoL" v-if="index == 0">
                                    <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">
                                        <img :src="item.imgurl">
                                        <span>{{ item.title }}</span>
                                    </NuxtLink>
                                    <NuxtLink
                                        :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                        target="_blank" v-if="item.islink==0">
                                        <img :src="item.imgurl">
                                        <span>{{ item.title }}</span>
                                    </NuxtLink>
                                </div>
                                <div class="photoL" v-if="index == 1">
                                    <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">
                                        <img :src="item.imgurl">
                                        <span>{{ item.title }}</span>
                                    </NuxtLink>
                                    <NuxtLink
                                        :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                        target="_blank" v-if="item.islink==0">
                                        <img :src="item.imgurl">
                                        <span>{{ item.title }}</span>
                                    </NuxtLink>
                                </div>
                            </article>
                        </div>
                    </div>
                    <div class="banner_text_list">
                        <ul>
                            <li v-for="item in pageData[11].data3">
                                <em></em>
                                <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">
                                    <span>{{ item.title }}</span>
                                </NuxtLink>
                                <NuxtLink
                                    :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                    target="_blank" v-if="item.islink==0">
                                    <span>{{ item.title }}</span>
                                </NuxtLink>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <!-- 十强称号logo -->
        <HomeTopTen :imgurl="adList[3]" v-if="adList[3]"></HomeTopTen>

        <!-- 第五层 -->
        <div class="scienceEducation">
            <div class="inner">
                <div class="innerLeft"  v-if="pageData.length>=13">
                    <div class="slider">
                        <div class="scienceTitle">
                            <h5>
                                <NuxtLink :to="{ path: `/newsList/${pageData[12].cid}`}" target="_blank" v-if="pageData[12]">
                                    {{ pageData[12].title }}
                                </NuxtLink>
                            </h5>
                            
                            <p class="title">
                                <span v-if="pageData[12]" @click="qhtabs(1)">
                                    <b v-if="showTabs == 1" class="active">{{ pageData[12].title1 }}</b>
                                    <b v-else class="noSelect">{{ pageData[12].title1 }}</b>
                                </span>
                                <span v-if="pageData[12]" @click="qhtabs(2)">
                                    <b v-if="showTabs == 2" class="active">{{ pageData[12].title2 }}</b>
                                    <b v-else class="noSelect">{{ pageData[12].title2 }}</b>
                                </span>
                                <span v-if="pageData[12]" @click="qhtabs(3)">
                                    <b v-if="showTabs == 3" class="active">{{ pageData[12].title3 }}</b>
                                    <b v-else class="noSelect">{{ pageData[12].title3 }}</b>
                                </span>
                                <span v-if="pageData[12]" @click="qhtabs(4)">
                                    <b v-if="showTabs == 4" class="active">{{ pageData[12].title4 }}</b>
                                    <b v-else class="noSelect">{{ pageData[12].title4 }}</b>
                                </span>
                            </p>
                        </div>
                        <div class="box">
                            <div class="scienceListBox">
                                <ul class="scienceList" v-if="showTabs == 1">
                                    <li v-for="item in pageData[12].data1">
                                        <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1"><img :src="item.imgurl"></NuxtLink>
                                        <NuxtLink
                                            :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                            target="_blank" v-if="item.islink==0"><img :src="item.imgurl"></NuxtLink>
                                        <p>
                                            <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                            <NuxtLink
                                                :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                                target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                                        </p>
                                    </li>
                                </ul>
                                <ul class="scienceList" v-if="showTabs == 2">
                                    <li v-for="item in pageData[12].data2">
                                        <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1"><img :src="item.imgurl"></NuxtLink>
                                        <NuxtLink
                                            :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                            target="_blank" v-if="item.islink==0"><img :src="item.imgurl"></NuxtLink>
                                        <p>
                                            <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                            <NuxtLink
                                                :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                                target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                                        </p>
                                    </li>
                                </ul>
                                <ul class="scienceList" v-if="showTabs == 3">
                                    <li v-for="item in pageData[12].data3">
                                        <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1"><img :src="item.imgurl"></NuxtLink>
                                        <NuxtLink
                                            :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                            target="_blank" v-if="item.islink==0"><img :src="item.imgurl"></NuxtLink>
                                        <p>
                                            <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                            <NuxtLink
                                                :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                                target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                                        </p>
                                    </li>
                                </ul>
                                <ul class="scienceList" v-if="showTabs == 4">
                                    <li v-for="item in pageData[12].data4">
                                        <img :src="item.imgurl">
                                        <p>
                                            <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                            <NuxtLink
                                                :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                                target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                                        </p>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="innerRight" v-if="pageData.length>=14">
                    <h3>
                        <NuxtLink :to="{ path: `/newsList/${pageData[13].cid}`}" target="_blank" v-if="pageData[13]">
                            {{ pageData[13].title }}
                        </NuxtLink>
                        <span>
                            <NuxtLink
                                :to="{ path: `/newsList/${pageData[13].cid}`, query: { catid: pageData[13].cid } }"
                                target="_blank" v-if="pageData[13]">查看更多</NuxtLink>
                        </span>

                    </h3>
                    <ul class="sannongList">
                        <li v-for="item in pageData[13].data3">
                            <em></em>
                            <span>
                                <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">{{ item.title }}</NuxtLink>
                                <NuxtLink
                                    :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                    target="_blank" v-if="item.islink==0">{{ item.title }}</NuxtLink>
                            </span>
                        </li>
                    </ul>
                    <div class="banner">
                        <HomeSmallSwiper :swiperData="pageData[13].data"></HomeSmallSwiper>
                    </div>
                    <div class="banner_b_img">
                        <div class="photo">
                            <article v-for="(item, index) in pageData[13].data2">
                                <div class="photoL" v-if="index == 0">
                                    <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">
                                        <img :src="item.imgurl">
                                        <span>{{ item.title }}</span>
                                    </NuxtLink>
                                    <NuxtLink
                                        :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                        target="_blank" v-if="item.islink==0">
                                        <img :src="item.imgurl">
                                        <span>{{ item.title }}</span>
                                    </NuxtLink>
                                </div>
                                <div class="photoL" v-if="index == 1">
                                    <NuxtLink :to="item.linkurl" target="_blank" v-if="item.islink==1">
                                        <img :src="item.imgurl">
                                        <span>{{ item.title }}</span>
                                    </NuxtLink>
                                    <NuxtLink
                                        :to="{ path: `/newsDetail/${item.id}`, query: { listId: routeId, listName: routeName } }"
                                        target="_blank"  v-if="item.islink==0">
                                        <img :src="item.imgurl">
                                        <span>{{ item.title }}</span>
                                    </NuxtLink>
                                </div>
                            </article>
                        </div>
                    </div>

                </div>
            </div>
        </div>

        <!-- 页脚部分 -->
        <HomeFoot1></HomeFoot1>
    </div>
</template>

<script setup>
//1.加载页面依赖 start ---------------------------------------->
//获得跳转过来的id
const route = useRoute();
const routeId = route.params.id; //获得该页面的id
const routeName = route.query.name; //获得该页面的名称
//1.加载页面依赖 end ---------------------------------------->

//2.页面交互效果 start ---------------------------------------->
//2.1 新闻图片切换
const hoverStatus = ref(1)
const qhPic = function (num) {
    console.log(num)
    hoverStatus.value = num;
}

//2.2 选项卡切换
let showTabs = ref(1)
let qhtabs = function (number) {
    console.log(number)
    showTabs.value = number
}
//2.3 展示广告
const adList = ref([]);
async function getadList() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteAdvertisement', {
        method: 'GET',
        query: {
            'ad_tag': 'CATEGORY',
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            adList.value = mkdata.value.data;
        }
    }
}
getadList()
//2.页面交互效果 end ---------------------------------------->

//3.渲染页面数据 start ---------------------------------------->
//3.1 该页面上所有的导航池 转为动态数据
const pageCategory = ref([]);
//3.2 该页面上需要渲染的所有数据
const pageData = ref([
    // { id: 0, data: [], data2: [], title: "", cid: "" },
    // { id: 1, data: [], title: "", cid: "" },
    // { id: 2, data: [], title: "", cid: "" },
    // { id: 3, data: [], title: "", cid: "" },
    // { id: 4, data: [], title: "", cid: "" },
    // { id: 5, data: [], title: "", cid: "" },
    // { id: 6, data: [], title: "", cid: "" },
    // { id: 7, data: [], title: "", cid: "" },
    // { id: 8, data: [], title: "", cid: "" },
    // { id: 9, data: [], title: "", cid: "" },
    // { id: 10, data: [], title: "", cid: "" },
    // { id: 10, data: [], title: "", cid: "" },
    // {
    //     id: 11,
    //     title: "",
    //     data: [],
    //     data1: [],
    //     data2: [],
    //     data3: [],
    //     data4: [],
    //     category_id1: "",
    //     category_id2: "",
    //     category_id3: "",
    //     category_id4: "",
    //     title1: "",
    //     title2: "",
    //     title3: "",
    //     title4: "",
    //     cid: ""
    // },
    // { id: 12, data1: [], data2: [], data3: [], cid: "" },
])

const navSize = ref("");

//3.3 获取所有导航
try {
    const navigateData = await requestDataPromise('/web/getWebsiteModelCategory', {
        method: 'GET',
        query: {
            'placeid': 1,
            'pid': routeId,
            'num': 14
        },
    });
    console.log("成功获取网站导航池！：", navigateData.data);
    // 遍历可用的导航池放到页面中
    for (let index in navigateData.data) {
        let data = {
            title: navigateData.data[index].name,
            cid: navigateData.data[index].category_id,
            children_count: navigateData.data[index].children_count,
            alias: navigateData.data[index].alias,
            data:[],
            data1:[],
            data2:[],
            data3:[],
            data4:[],
            category_id1:"",
            category_id2:"",
            category_id3:"",
            category_id4:"",
            title1: "",
            title2: "",
            title3: "",
            title4: ""
        };
        if (navigateData.data[index].is_url == 1) {
            // 处理 URL 的逻辑
        } else {
            pageData.value.push(data);
        }
    }
    //导航池加载完毕，开始申请模块数据
    await getPageData1();
    await getPageData1_data2();
    await getPageData2();
    await getPageData3();
    await getPageData4();
    await getPageData5();
    await getPageData6();
    await getPageData7();
    await getPageData8();
    await getPageData9();
    await getPageData10();
    await getPageData11();
    await getPageData12();
    await getPageData12_data2();
    await getPageData12_data3();
    await getPageData13();
    if(navSize.value>=1){
        await getPageData13_data1();
    }
    if(navSize.value>=2){
        await getPageData13_data2();
    }
    if(navSize.value>=3){
        await getPageData13_data3();
    }
    if(navSize.value>=4){
        await getPageData13_data4();
    }
    await getPageData14();
    await getPageData14_data2();
    await getPageData14_data3();
    await getSeo();
} catch (error) {
    console.error('获取页面导航失败！:', error);
}

//模块1
async function getPageData1() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[0].cid,
            'level': 3,
            'pagesize': 8
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[0].data = mkdata.value.data;
        }
    }
}
async function getPageData1_data2() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[0].cid,
            'level': 3,
            'pagesize': 4
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[0].data2 = mkdata.value.data;
        }
    }
}
//模块2
async function getPageData2() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[1].cid,
            'level': 3,
            'pagesize': 5
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[1].data = mkdata.value.data;
        }
    }
}
//模块3
async function getPageData3() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[2].cid,
            'level': 3,
            'pagesize': 6
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[2].data = mkdata.value.data;
        }
    }
}
//模块4
async function getPageData4() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[3].cid,
            'level': 3,
            'pagesize': 6
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[3].data = mkdata.value.data;
        }
    }
}
//模块5
async function getPageData5() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[4].cid,
            'level': 3,
            'pagesize': 6
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[4].data = mkdata.value.data;
        }
    }
}
//模块6
async function getPageData6() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[5].cid,
            'level': 3,
            'pagesize': 4
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[5].data = mkdata.value.data;
        }
    }
}
//模块7
async function getPageData7() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[6].cid,
            'level': 3,
            'pagesize': 5
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[6].data = mkdata.value.data;
        }
    }
}
//模块8
async function getPageData8() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[7].cid,
            'level': 3,
            'pagesize': 5
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[7].data = mkdata.value.data;
        }
    }
}
//模块9
async function getPageData9() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[8].cid,
            'level': 3,
            'pagesize': 4
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[8].data = mkdata.value.data;
        }
    }
}
//模块10
async function getPageData10() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[9].cid,
            'level': 1,
            'pagesize': 10
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[9].data = mkdata.value.data;
        }
    }
}
//模块11
async function getPageData11() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[10].cid,
            'level': 1,
            'pagesize': 10
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[10].data = mkdata.value.data;
        }
    }
}
//模块12
async function getPageData12() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[11].cid,
            'level': 2,
            'pagesize': 4
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[11].data = mkdata.value.data;
        }
    }
}
async function getPageData12_data2() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[11].cid,
            'level': 3,
            'pagesize': 2
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[11].data2 = mkdata.value.data;
        }
    }
}
async function getPageData12_data3() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[11].cid,
            'level': 1,
            'pagesize': 5
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[11].data3 = mkdata.value.data;
        }
    }
}


async function getPageData13() {
    const navData =  await requestDataPromise('/web/getWebsiteModelCategory', {
        method: 'GET',
        query: {
            'pid': pageData.value[12].cid,
            'placeid': 1,
            'num': 4
        },
    });
    let mkLength = navData.data.length;
    navSize.value = navData.data.length;
    if(mkLength != 0){
        for (let i = 1; i <= mkLength; i++) {
            if (i == 1) {
                pageData.value[12].title1 = navData.data[0].name;
                pageData.value[12].category_id1 = navData.data[0].category_id;
            }
            if (i == 2) {
                pageData.value[12].title2 = navData.data[1].name;
                pageData.value[12].category_id2 = navData.data[1].category_id;
            }
            if (i == 3) {
                pageData.value[12].title3 = navData.data[2].name;
                pageData.value[12].category_id3 = navData.data[2].category_id;
            }
            if (i == 4) {
                pageData.value[12].title4 = navData.data[3].name;
                pageData.value[12].category_id4 = navData.data[3].category_id;
            }
        }
    }
}

async function getPageData13_data1() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[12].category_id1,
            'level': 3,
            'pagesize': 6
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        console.log(999)
        console.log(mkdata.value)
        if (mkdata.value) {
            pageData.value[12].data1 = mkdata.value.data;
        }
    }
}
async function getPageData13_data2() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[12].category_id2,
            'level': 3,
            'pagesize': 6
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[12].data2 = mkdata.value.data;
        }
    }
}
async function getPageData13_data3() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[12].category_id3,
            'level': 3,
            'pagesize': 6
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[12].data3 = mkdata.value.data;
        }
    }
}
async function getPageData13_data4() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[12].category_id4,
            'level': 3,
            'pagesize': 6
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[12].data4 = mkdata.value.data;
        }
    }
}

//模块14
async function getPageData14() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[13].cid,
            'level': 2,
            'pagesize': 4
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[13].data = mkdata.value.data;
        }
    }
}
async function getPageData14_data2() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[13].cid,
            'level': 3,
            'pagesize': 2
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[13].data2 = mkdata.value.data;
        }
    }
}
async function getPageData14_data3() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteModelArticles', {
        method: 'GET',
        query: {
            'catid': pageData.value[13].cid,
            'level': 1,
            'pagesize': 5
        },
    });
    if (mkdataError.value) {
        //console.log()
    } else {
        if (mkdata.value) {
            pageData.value[13].data3 = mkdata.value.data;
        }
    }
}
//3.渲染页面数据 end ---------------------------------------->

//4.设置seo信息 start---------------------------------------->
//4.1 设置seo信息
async function getSeo() {
    const setData =  await requestDataPromise('/web/getWebsiteCategoryHead', {
        method: 'GET',
        query: {
            'catid': routeId
        },
    });
    seoSetup(setData.data.seo_title,setData.data.seo_description,setData.data.seo_keywords)
}
//4.设置seo信息 end---------------------------------------->
</script>

<style lang="less" scoped>
    @import '@/assets/css/class.less';
</style>